package com.thread.www;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author 新技术软件：汪洋
 */
public class AutomicTest {
    public static void main(String[] args){
        atomicIntegerTest();
    }
    public static void atomicIntegerTest(){
        AtomicInteger ai = new AtomicInteger(0);
        System.out.println(ai.get());
        System.out.println(ai.getAndSet(5));
        System.out.println(ai.getAndIncrement());
        System.out.println(ai.getAndDecrement());
        System.out.println(ai.getAndAdd(10));
        System.out.println(ai.get());
    }


}
